<!DOCTYPE html>
<html>
<head>
	<title>Ebac-Agenda 2011</title>
	<base href="../"/>
	<link href="/agenda_16.png" rel="shortcut icon" type="image/x-icon" />
	<link href="/core/css/themes/crispin/jxtheme.css" rel="stylesheet" type="text/css" media="screen"/>
	<link href="/user/css/core.css" rel="stylesheet" type="text/css" media="screen">
	<style type="text/css">
		body {

		/*-moz-binding: url(xbl/test.xbl#nav-then-main);*/
		-webkit-binding:url(/xbl/test.xbl#nav-then-main)
		}
		#main_modal{background-color:rgba(0,0,0,0.5);
		width:100%;
		height:100%;
		z-index:1313;
		position:fixed
		}
		#dialogo{
			display:block;
			background:white;
			border:2px solid gray;
			width:300px;
			height:300px;
			margin:auto auto;
			border-radius:13px 13px 5px 5px;
		}
	</style>
	<script type="text/javascript" src="core/javascript/jxlib_all_uncompress.js" id="core_jxlib"
	        charset="utf-8"></script>
	<script type="text/javascript" charset="utf-8">
		chrome.contextMenus.removeAll(function(){
			console.log("Deshabilitado");

		});
		Jx.setLanguage('es-BO');
		window.addEvents({
			'keydown':function(tecla){
				switch(tecla.key)
				{
					case 'f5': tecla.stop();break;
					case 'alt': $('Aplicacion').addClass('active_accesskey');break;
				}
			},
			'keyup':function(tecla){
				$('Aplicacion').removeClass('active_accesskey');
			},
			"blur":function(){
				//alert("no te vayas");
				//window.focus();
				document.getElementById('Aplicacion').focus();
			}
		});


function drawPositionedDialog() {

    /* another simple dialog that picks up its content from an existing
     * element by id and has an initial starting position.  It is also
     * modal.
     */
    d2 = new Jx.Dialog({
        label: {set:'Examples',key:'dialog',value:'dialogModal'},
        image: 'images/page_white_code.png',
        modal: true,
        horizontal: '200 left',
        vertical: '50 top',
        content: 'inlineContent',
        resize: true,
        maximize: true,
        useKeyboard: true,
        //limit: {x:[0,window.getCoordinates().right], y:[0,window.getCoordinates().bottom]},
        limit: document,
        // example how to add custom keyboard shortcuts, this also works with subclasses
        keys : {
          'alt+enter' : 'maximizeDialog',
          'ctrl+up' : function(ev) {
            ev.preventDefault();
            this.toggleCollapse(true);
          },
          'ctrl+down' : function(ev) {
            ev.preventDefault();
            this.toggleCollapse(false);
          }
        },
        keyboardMethods : {
          'maximizeDialog' : function(ev) {
            ev.preventDefault();
            this.maximize();
          }
        }
    });

    new Jx.Button({
        image: 'images/page_white_code.png',
        label: {set:'Examples',key:'dialog',value:'btnModal'},
        onClick: d2.open.bind(d2)
    }).addTo('toolbar_id');
}
function setupFileUploadNoProgress(){
    var uploadPanel  = new Jx.Panel.FileUpload({
        label: 'Upload File Test',
        file: {
            progress: false,
            handlerUrl: 'upload.php',
            id: 'file-upload-test',
            name: 'file-upload-test',
            label: 'File to Upload',
            debug: true,
            mode: 'multiple'
        },
        prompt: 'Choose some files to upload',
        removeOnComplete: true,
        onFileUploadComplete: function(filename){
            log("File " + filename + " Uploaded.");
        },
        onAllUploadsCompleted: function() {
            log("All Files Uploaded.");
        }
    });
    uploadPanel.addTo('Aplicacion');
    $(uploadPanel).resize();
}

	</script>
</head>
<body>
	<div id="main_modal">
		<dialogo id="dialogo">
		centrado y otro
		</dialogo>
	</div>
	<div id="Aplicacion">Cargando....</div>
<div id="main_body">
   <h1>Demo</h1>
   ...
  </div>
  <div class="nav">
   <p><a href="http://example.com/">Home</a></p>
   ...
  </div>
	<script type="text/javascript" charset="utf-8">
$('main_modal').addEvent("click",function(){
	this.set("style","display:none");
	
	(function(){
	console.log(this);
	this.set("style",false);
	console.log(this);
	}).bind(this).delay(1000);
});
window.addEvent("resize",function(){
	console.log("resize la ventan windows");
});
$('main_modal').addEvent("scroll",function(){
console.log("mueve scroll");
});
		new Jx.Layout('Aplicacion');

var toolbar = new Jx.Toolbar({id:"toolbar_id"});

var sayHello = new Jx.Button({
  label: 'Say Hello',
  onClick: function() {
    //alert('Hello!');
	//boton();
	//$jx('toolbar_id').render();
  }
});

toolbar.add(sayHello);
toolbar.add(
	new Jx.Button({
	  label: 'victor',
	  onClick: function() {
		this.setLabel("jeej");
		//this.setEnabled(false);
		panel.setContentURL("http://localhost/core/index.php");
	  }
	})
);
toolbar.add(
	new Jx.Button({
	  label: 'Montar dialogo',
	  onClick: function() {
		drawPositionedDialog();

	  }
	})
);
toolbar.add(new Jx.Button({
	  label: '[C]argar archivo',
		toggle:true,
	  accesskey:'C',
	  href:false,
	  onClick: function() {
	    setupFileUploadNoProgress();
	  }
}));
var panel = new Jx.Panel({
	collapse:false,
	hideTitle:true,
   label: "Software Victor 1.0",
  id:"body",
  toolbars: [toolbar],
  content:$('main_body').get("html")
});
$('main_body').set("text","");
$('Aplicacion').resize();
panel.addTo('Aplicacion');

	</script>
</body>
</html>